<extend name="Base/common"/>
<block name="Content">
	<div class="am-cf am-padding-top">
        <div class="am-fl am-cf">
            <i class="am-icon-pencil-square-o"></i>
            <strong class="am-text-primary am-text-lg">
               <notempty name="detailModel">
                    编辑<else/>新增
                </notempty>服务细分项
            </strong>
        </div><hr data-am-widget="divider" class="am-divider am-divider-default" />
    </div>
	<form class="am-form" method="post" action="{:U('saveDetailAction')}">
		<div class="am-g am-margin-top">
             <div class="am-u-sm-4 am-u-md-2 am-text-right">
                 服务类型
             </div>
             <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                 {$classModel['class_name']}
             </div>
             <div class="am-hide-sm-only am-u-md-6">
             </div>
        </div>
        <div class="am-g am-margin-top">
             <div class="am-u-sm-4 am-u-md-2 am-text-right">
                 细分项名称
             </div>
             <div class="am-u-sm-8 am-u-md-4">
                 <input type="text" class="am-input-sm" name="detail_name" value="{$detailModel['detail_name']}" required/>
             </div>
             <div class="am-hide-sm-only am-u-md-6">
                 *必填，不可重复
             </div>
        </div>
        <div class="am-g am-margin-top">
             <div class="am-u-sm-4 am-u-md-2 am-text-right">
                 单价
             </div>
             <div class="am-u-sm-8 am-u-md-4">
                 <input type="number" class="am-input-sm" min="0" step="1" 
                 	name="price" value="{$detailModel['price']|default='1'}" required/>
             </div>
             <div class="am-hide-sm-only am-u-md-6">
                 *必填，单价为0表示面议
             </div>
        </div>
        <div class="am-g am-margin-top">
			<div class="am-u-sm-4 am-u-md-2 am-text-right">
                 计量单位
            </div>
            <div class="am-u-sm-8 am-u-md-4">
             	<select name="unit" id="unit"
               		data-am-selected="{btnSize: 'sm', btnStyle: 'secondary',maxHeight: 200}">
                    <volist name=":get_dictionary_enum('unit_options')" id="vo">
						<option value="{$key}">{$vo.enum_name}</option>
					</volist>
				</select>
            </div>
            <div class="am-hide-sm-only am-u-md-6">
            </div>
        </div>
        <div class="am-g am-margin-top">
            <div class="am-u-sm-4 am-u-md-2 am-text-right">
                是否允许紧急服务
            </div>
            <div class="am-u-sm-8 am-u-md-4">
            	<input type="radio" name="emergency" value="1"/>是<input type="radio" name="emergency" value="2"/>否
            </div>
            <div class="am-hide-sm-only am-u-md-6">
            </div>
        </div>
        <div class="am-g am-margin-top">
             <div class="am-u-sm-4 am-u-md-2 am-text-right">
                 关键字（可用于用户搜索）
             </div>
             <div class="am-u-sm-8 am-u-md-4">
                 <input type="text" class="am-input-sm" name="kwords" value="{$detailModel['kwords']}"/>
             </div>
             <div class="am-hide-sm-only am-u-md-6">
             </div>
        </div>
             
		<div class="am-margin">
			<button type="submit" class="am-btn am-btn-success am-btn-xs ajax-post" target-form="am-form">
                     提交保存
			</button>
			<button type="button" class="am-btn am-btn-secondary am-btn-xs" onclick="javascript:history.back(-1);return false;">
               返回列表
           	</button>
           	<input type="hidden" name="detail_id" value="{$detailModel['detail_id']}"/>
           	<input type="hidden" name="class_id" value="{$classModel['class_id']}"/>
       </div>
   </form>
</block>

<block name="script">
<script type="text/javascript">
Think.setValue('unit',{$detailModel.unit|default=0});
Think.setValue('emergency',{$detailModel.emergency|default=2});
</script>

</block>